/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.feedback.service.order;

import cn.hutool.core.util.ObjectUtil;
import info.peigen.hotpot.common.core.result.ResultCode;
import info.peigen.hotpot.common.service.base.ServiceOrderBase;
import info.peigen.hotpot.common.service.base.exception.BusinessException;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import java.util.List;

/**
 * <b>(FeedbackOrder)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/11/16
 */
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class FeedbackOrder extends ServiceOrderBase {
    String       context;
    List<String> images;

    @Override
    public void check() {
        super.check();
        if (ObjectUtil.isAllEmpty(context, images)) {
            throw new BusinessException(ResultCode.FAILURE, "context和images不得同时为空!");
        }
    }
}